import React, { Component } from 'react';
import { StyleSheet, TouchableOpacity, Clipboard, Image, TextInput } from 'react-native';
import { Container, Content, View, Button, Text, Icon } from 'native-base';
import { ListItem, Input } from 'react-native-elements';
import { connect } from 'react-redux';
import Moment from 'moment';
import LinearGradient from 'react-native-linear-gradient';

import { Header, Loading } from '../../component';
import { Colors, Metrics } from '../../theme';


class ReceiptAccount extends Component {
	constructor(props) {
		super(props);
		this.state = {
			isLoading: false,
			realName: '',
			idCard: '',
		}
	}


	UNSAFE_componentWillMount() {

	}

	componentDidMount() {

	}

	render() {
		let { phone, nickName, inviteCode, regTime, position, inviter } = this.props;
		return (
			<Container>
				<Header title="实名认证" onLeftPress={() => this.props.navigation.goBack()} />
				<Loading showLoading={this.state.isLoading} />
				<Content padder>
					<View style={Styles.container}>
						
					<TextInput
						inputStyle={Styles.inputText}
						placeholder='请输入姓名'
						value={this.state.realName}
						onChangeText={(value) => this.setState({ realName: value })}
					/>

					<TextInput
						inputStyle={Styles.inputText}
						placeholder="请输入支付宝账号"
						value={this.state.idCard}
						onChangeText={(value) => this.setState({ idCard: value })}
					/>

					<TextInput
						inputStyle={Styles.inputText}
						placeholder="再次输入支付宝账号"
						value={this.state.idCard}
						onChangeText={(value) => this.setState({ idCard: value })}
					/>


					<View style={Styles.signInView}>
						<TouchableOpacity onPress={() => {}} disabled={this.state.isLoading}  disabled={this.state.isLoading}>
							<LinearGradient style={{ width: Metrics.screenWidth * 0.6, alignItems: "center", borderRadius: 8 }} colors={[Colors.subjectJbZuo, Colors.subject]} start={{ x: 0, y: 0 }} end={{ x: 1, y: 0 }}>
								<Text style={{ fontSize: 14, padding: 12, color: Colors.bai }}>{`${this.state.isLoading ? "请求中..." : "提交"}`}</Text>
							</LinearGradient>
						</TouchableOpacity>
					</View>

					</View>
				</Content>
			</Container>
		);
	}

}

const mapStateToProps = state => ({
	logged: state.user.logged,
	token: state.user.token,
	phone: state.user.phone,
	nickName: state.user.nickName,
	head_portrait: state.user.head_portrait,
	inviteCode: state.user.inviteCode,
	inviter: state.user.inviter,
	position: state.user.position,
	regTime: state.user.regTime,
	level: state.user.level,

});

const mapDispatchToProps = dispatch => ({

});

export default connect(mapStateToProps, mapDispatchToProps)(ReceiptAccount);

const Styles = StyleSheet.create({
	container: { flex: 1, backgroundColor: Colors.bai, paddingBottom: 20 },
	signInView: { marginTop: 36, alignItems: "center" },
	inputText: {fontSize: 14, padding: 6, marginTop: 8,},
});